import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: () => import('@/views/Login')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/Home'),
    redirect: '/welcome',
    children: [{
        path: '/users',
        name: 'users',
        component: () => import('@/views/Home/Users/user')
      },
      {
        path: '/roles',
        name: 'roles',
        component: () => import('@/views/Home/Rights/roles')
      },
      {
        path: '/rights',
        name: 'rights',
        component: () => import('@/views/Home/Rights/rights')
      },
      {
        path: '/welcome',
        name: 'welcome',
        component: () => import('@/views/Home/welcome')
      }
    ]

  }
  // {
  //   path: '/about',
  //   name: 'About',
  //   component: () => import('../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router